public class huzhishu {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i < 2020; i++) {
            if (gcd(2020, i) == 1) {
                count++;
            }
        }
        System.out.println(count);
    }

    //求x和y的最大公约数
    public static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        }
        return gcd(y, x % y);
    }
}
